<topicVersion>
  <topicName>PreformattedFormattingRules</topicName>
  <wikiDir>WikiRoot\WikiDir</wikiDir>
  <creator></creator>
  <createdOn>2013-03-05T12:09:51.805</createdOn>
  <version>2</version>
  <editReason />
  <wikiText>Also see CodeFormattingRules for output of code examples.

!!Whitespace Prefix
:Keywords: Formatting, Examples
Any line starting with whitespace becomes preformatted text:

 Public Class MyClass
    Public Sub New()
        DoCoolStuff()
        If IsReallyCool Then
            DoSomethingEvenMoreCool()
        End If
    End Sub
 End Class
 public class CSharpExample {
    CSharpExample() {
       int n = 5;
       object[] test = new object[n];
    }
 }

Text inside of a PRE block doesn't get hyperlinks automatically added to it.
 
 Here is another '''example.'''

!!Non-indented preformatted text 

It is difficult to cut and paste source files into Wiki and then insert 1 space before every line. The "PRE block" solves this problem. There are 2 usage scenarios: ''simple syntax'' and ''syntax with a key''.

!!!Simple Syntax:

{@Key
{@
your text goes
here and it does not have to start with space or tab
}@
}@Key
Produces:
{@
your text goes
here and it does not have to start with space or tab
}@

!!!Syntax with key (if for some reason your text contains }@ at the beginning of a line)
{@RealKey
{@UniqKey
any text
here including
}@ at line beginning
still inside pre
}@WrongKey
still inside pre
}@UniqKey
}@RealKey
Produces:
{@UniqKey
any text
here including
}@ at line beginning
still inside pre
}@WrongKey
still inside pre
}@UniqKey

!!!Extended Syntax

For purposes of showing large amounts of code, a lot of developers are used to seeing code presented with color syntax highlighting. To allow for this, you can use the ""{+"" ... ""}+"" syntax and then use the normal FlexWiki FormattingRules to apply styles. For example, this code
 {+
    %blue%public void%% Foo()
    {
        %green%// comment here%%
        %blue%string%% s;
        *...*
    }
 }+

Would result in this output
{+
   %blue%public void%% Foo()
   {
       %green%// comment here%%
       %blue%string%% s;
       *...*
   }
}+
which will look extremely familiar to all of the Visual Studio developers out there.

Most of the normal FlexWiki processing is done on this text, it just maintains the fixed-width font and the whitespace presentation that is normally associated with the {@ ... }@ FlexWiki tag or the &lt;pre&gt; HTML tag. This processing includes "Simple":SimpleFormattingRules , "Linking":LinkingFormattingRules, "Text size and Color":TextSizeAndColorFormattingRules, and "Alternative or Textile":TexttileFormattingRules formatting rules.
</wikiText>
  <body>&lt;WomDocument&gt;
&lt;BaseTopic&gt;http://localhost/LynxWiki/WikiTopic/Index&lt;/BaseTopic&gt;
&lt;BaseEdit&gt;http://localhost/LynxWiki/WikiTopic/Page&lt;/BaseEdit&gt;
&lt;BaseImage&gt;http://localhost/LynxWiki/images/&lt;/BaseImage&gt;
&lt;SiteUrl&gt;http://localhost/LynxWiki/&lt;/SiteUrl&gt;
&lt;InputDoc&gt;&lt;/InputDoc&gt;

&lt;Para&gt;&lt;paraText&gt;Also see &lt;/paraText&gt;&lt;CreateNewTopic&gt;&lt;StartsWithOneCap&gt;CodeFormattingRules&lt;/StartsWithOneCap&gt;&lt;Namespace&gt;\WikiRoot\WikiDir&lt;/Namespace&gt;&lt;/CreateNewTopic&gt;&lt;paraText&gt; for output of code examples.&lt;/paraText&gt;&lt;/Para&gt;
&lt;Header level="2"&gt;
&lt;womHeaderText&gt;Whitespace Prefix&lt;/womHeaderText&gt;&lt;AnchorText&gt;_1_Whitespace_Prefix&lt;/AnchorText&gt;&lt;/Header&gt;&lt;HiddenSinglelineProperty&gt;&lt;Name&gt;Keywords&lt;/Name&gt;
&lt;womPropertyText&gt; Formatting, Examples&lt;/womPropertyText&gt;&lt;/HiddenSinglelineProperty&gt;
&lt;Para&gt;&lt;paraText&gt;Any line starting with whitespace becomes preformatted text:&lt;/paraText&gt;&lt;/Para&gt;

&lt;PreformattedSingleLine&gt; Public Class MyClass
    Public Sub New()
	DoCoolStuff()
	If IsReallyCool Then
	    DoSomethingEvenMoreCool()
	End If
    End Sub
 End Class
 public class CSharpExample {
    CSharpExample() {
       int n = 5;
       object[] test = new object[n];
    }
 }&lt;/PreformattedSingleLine&gt;

&lt;Para&gt;&lt;paraText&gt;Text inside of a PRE block doesn't get hyperlinks automatically added to it.&lt;/paraText&gt;&lt;/Para&gt;

&lt;PreformattedSingleLine&gt; 
 Here is another '''example.'''&lt;/PreformattedSingleLine&gt;
&lt;Header level="2"&gt;
&lt;womHeaderText&gt;Non-indented preformatted text &lt;/womHeaderText&gt;&lt;AnchorText&gt;_2_Non-indented_preformatted_text_&lt;/AnchorText&gt;&lt;/Header&gt;
&lt;Para&gt;&lt;paraText&gt;It is difficult to cut and paste source files into Wiki and then insert 1 space before every line. The "PRE block" solves this problem. There are 2 usage scenarios: &lt;/paraText&gt;&lt;Italics&gt;simple syntax&lt;/Italics&gt;&lt;paraText&gt; and &lt;/paraText&gt;&lt;Italics&gt;syntax with a key&lt;/Italics&gt;&lt;paraText&gt;.&lt;/paraText&gt;&lt;/Para&gt;
&lt;Header level="3"&gt;
&lt;womHeaderText&gt;Simple Syntax:&lt;/womHeaderText&gt;&lt;AnchorText&gt;_3_Simple_Syntax&lt;/AnchorText&gt;&lt;/Header&gt;&lt;PreformattedMultilineKeyed&gt;&lt;womMultilineCode&gt;
{@
your text goes
here and it does not have to start with space or tab
}@&lt;/womMultilineCode&gt;
&lt;/PreformattedMultilineKeyed&gt;
&lt;Para&gt;&lt;paraText&gt;Produces:&lt;/paraText&gt;&lt;/Para&gt;
&lt;PreformattedMultiline&gt;&lt;womMultilineCode&gt;
your text goes
here and it does not have to start with space or tab
&lt;/womMultilineCode&gt;
&lt;/PreformattedMultiline&gt;&lt;Header level="3"&gt;
&lt;womHeaderText&gt;Syntax with key (if for some reason your text contains }@ at the beginning of a line)&lt;/womHeaderText&gt;&lt;AnchorText&gt;_4_Syntax_with_key_if_for_some_reason_your_text_contains__at_the_beginning_of_a_line&lt;/AnchorText&gt;&lt;/Header&gt;&lt;PreformattedMultilineKeyed&gt;&lt;womMultilineCode&gt;
{@UniqKey
any text
here including
}@ at line beginning
still inside pre
}@WrongKey
still inside pre
}@UniqKey&lt;/womMultilineCode&gt;
&lt;/PreformattedMultilineKeyed&gt;
&lt;Para&gt;&lt;paraText&gt;Produces:&lt;/paraText&gt;&lt;/Para&gt;
&lt;PreformattedMultilineKeyed&gt;&lt;womMultilineCode&gt;
any text
here including
}@ at line beginning
still inside pre
}@WrongKey
still inside pre&lt;/womMultilineCode&gt;
&lt;/PreformattedMultilineKeyed&gt;&lt;Header level="3"&gt;
&lt;womHeaderText&gt;Extended Syntax&lt;/womHeaderText&gt;&lt;AnchorText&gt;_5_Extended_Syntax&lt;/AnchorText&gt;&lt;/Header&gt;
&lt;Para&gt;&lt;paraText&gt;For purposes of showing large amounts of code, a lot of developers are used to seeing code presented with color syntax highlighting. To allow for this, you can use the &lt;/paraText&gt;&lt;EscapedNoFormatText&gt;{+&lt;/EscapedNoFormatText&gt;&lt;paraText&gt; ... &lt;/paraText&gt;&lt;EscapedNoFormatText&gt;}+&lt;/EscapedNoFormatText&gt;&lt;paraText&gt; syntax and then use the normal &lt;/paraText&gt;&lt;CreateNewTopic&gt;&lt;StartsWithOneCap&gt;FlexWiki&lt;/StartsWithOneCap&gt;&lt;Namespace&gt;\WikiRoot\WikiDir&lt;/Namespace&gt;&lt;/CreateNewTopic&gt;&lt;paraText&gt; &lt;/paraText&gt;&lt;CreateNewTopic&gt;&lt;StartsWithOneCap&gt;FormattingRules&lt;/StartsWithOneCap&gt;&lt;Namespace&gt;\WikiRoot\WikiDir&lt;/Namespace&gt;&lt;/CreateNewTopic&gt;&lt;paraText&gt; to apply styles. For example, this code&lt;/paraText&gt;&lt;/Para&gt;

&lt;PreformattedSingleLine&gt; {+
    %blue%public void%% Foo()
    {
	%green%// comment here%%
	%blue%string%% s;&lt;/PreformattedSingleLine&gt;
&lt;list type="unordered"&gt;&lt;item&gt;
&lt;womListText&gt;...*&lt;/womListText&gt;&lt;/item&gt;&lt;/list&gt;

&lt;PreformattedSingleLine&gt;    }
 }+&lt;/PreformattedSingleLine&gt;

&lt;Para&gt;&lt;paraText&gt;Would result in this output&lt;/paraText&gt;&lt;/Para&gt;
&lt;ExtendedCode&gt;&lt;womStyledCode&gt;&amp;#160;&amp;#160;&amp;#160;&lt;/womStyledCode&gt;&lt;WikiStyling&gt;&lt;StyleColor&gt;blue&lt;/StyleColor&gt;&lt;womWikiStyledText&gt;public void&lt;/womWikiStyledText&gt;&lt;/WikiStyling&gt;&lt;womStyledCode&gt;&amp;#160;Foo()&lt;Break /&gt;&amp;#160;&amp;#160;&amp;#160;{&lt;Break /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/womStyledCode&gt;&lt;WikiStyling&gt;&lt;StyleColor&gt;green&lt;/StyleColor&gt;&lt;womWikiStyledText&gt;// comment here&lt;/womWikiStyledText&gt;&lt;/WikiStyling&gt;&lt;womStyledCode&gt;&lt;Break /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/womStyledCode&gt;&lt;WikiStyling&gt;&lt;StyleColor&gt;blue&lt;/StyleColor&gt;&lt;womWikiStyledText&gt;string&lt;/womWikiStyledText&gt;&lt;/WikiStyling&gt;&lt;womStyledCode&gt;&amp;#160;s;&lt;Break /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/womStyledCode&gt;&lt;TextileStrongInLine&gt;...&lt;/TextileStrongInLine&gt;&lt;womStyledCode&gt;&lt;Break /&gt;&amp;#160;&amp;#160;&amp;#160;}&lt;/womStyledCode&gt;&lt;/ExtendedCode&gt;
&lt;Para&gt;&lt;paraText&gt;which will look extremely familiar to all of the Visual Studio developers out there.&lt;/paraText&gt;&lt;/Para&gt;

&lt;Para&gt;&lt;paraText&gt;Most of the normal &lt;/paraText&gt;&lt;CreateNewTopic&gt;&lt;StartsWithOneCap&gt;FlexWiki&lt;/StartsWithOneCap&gt;&lt;Namespace&gt;\WikiRoot\WikiDir&lt;/Namespace&gt;&lt;/CreateNewTopic&gt;&lt;paraText&gt; processing is done on this text, it just maintains the fixed-width font and the whitespace presentation that is normally associated with the {@ ... }@ &lt;/paraText&gt;&lt;CreateNewTopic&gt;&lt;StartsWithOneCap&gt;FlexWiki&lt;/StartsWithOneCap&gt;&lt;Namespace&gt;\WikiRoot\WikiDir&lt;/Namespace&gt;&lt;/CreateNewTopic&gt;&lt;paraText&gt; tag or the &amp;lt;pre&amp;gt; HTML tag. This processing includes &lt;/paraText&gt;&lt;paraText&gt; , &lt;/paraText&gt;&lt;paraText&gt;, &lt;/paraText&gt;&lt;paraText&gt;, and &lt;/paraText&gt;&lt;paraText&gt; formatting rules.&lt;/paraText&gt;&lt;/Para&gt;
&lt;/WomDocument&gt;
</body>
</topicVersion>